package com.banban.user.enums;

public enum FieldEnum {
    NAME("name", "姓名"),
    GENDER("gender", "性别"),
    AGE_GROUP("ageGroup", "年龄"),
    PERSONALITY("personality", "性格"),
    HOMETOWN("hometown", "籍贯"),
    REGION("region", "地域"),
    MARITAL_STATUS("maritalStatus", "婚姻状况"),
    FAMILY_STRUCTURE("familyStructure", "家庭结构"),
    OCCUPATION("occupation", "职业"),
    INCOME_LEVEL("incomeLevel", "收入水平"),
    EDUCATION_LEVEL("educationLevel", "教育程度"),
    INDUSTRY_FIELD("industryField", "行业领域"),
    SOCIAL_CLASS("socialClass", "社会阶层"),
    INTERESTS("interests", "兴趣爱好"),
    CONSUMPTION_HABIT("consumptionHabit", "消费习惯"),
    PROMOTION_SENSITIVITY("promotionSensitivity", "促销敏感度"),
    AVERAGE_ORDER_VALUE_RANGE("averageOrderValueRange", "客单价区间"),
    VALUES("values", "价值观"),
    LIFESTYLE("lifestyle", "生活方式"),
    SHOPPING_CHANNEL("shoppingChannel", "购物渠道"),
    PAYMENT_METHOD("paymentMethod", "支付方式"),
    CONTENT_CONSUMPTION("contentConsumption", "内容消费"),
    SOCIAL_PLATFORM("socialPlatform", "社交平台"),
    TRAVEL_HABIT("travelHabit", "出行习惯"),
    HEALTH_MANAGEMENT("healthManagement", "健康管理"),
    EDUCATION_DEMAND("educationDemand", "教育需求"),
    FAMILY_ROLE("familyRole", "家庭角色"),
    DIGITAL_NATIVE("digitalNative", "数字原住民"),
    SPECIAL_GROUP("specialGroup", "特殊群体"),
    DEVICE_TYPE("deviceType", "设备类型"),
    NETWORK_ENVIRONMENT("networkEnvironment", "网络环境"),
    VISIT_FREQUENCY("visitFrequency", "访问频率"),
    USAGE_DURATION("usageDuration", "使用时长"),
    TIME_OF_DAY("timeOfDay", "时间"),
    USAGE_FREQUENCY("usageFrequency", "使用频率"),
    USER_ENGAGEMENT("userEngagement", "用户使用度"),
    PERSONALIZED_DEMAND("personalizedDemand", "个性化诉求");

    private final String code;
    private final String name;

    FieldEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据字段编码获取字段名称
     * @param code 字段编码
     * @return 字段名称
     */
    public static String getNameByCode(String code) {
        for (FieldEnum field : FieldEnum.values()) {
            if (field.getCode().equals(code)) {
                return field.getName();
            }
        }
        return null; // 如果没有找到对应的编码，返回null
    }

    public static void main(String[] args) {
        String name1 = getNameByCode("name");
        System.out.println(name1);
    }
}
